/**
 * @author: lk
 * @data: 2021/11/11 13:01
 */
package core_java.inheritance;

public class ManagerTest {
    /**
     * 多态测试。Employ类型引用e可以调用其子类的方法。
     */
    public static void main(String[] args) {
        var boss = new Manager("Me", 10000, 1997, 1, 2, 2000);
        Employee[] staff = new Employee[3];
        staff[0]  = boss;
        staff[1] = new Employee("Staff A", 9999, 2000, 2, 2);
        staff[2] = new Employee("Staff B", 9999, 2001, 2, 2);
        for (Employee e :
                staff) {
            System.out.printf("Name = %s, salary = %10.2f\n",e.getName(),e.getSalary());
        }

    }
}
